package com.bootlever.framework.zookeeper.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "bootlever.framework.zookeeper")
public class ZookeeperProperties {

    private static final String DEFAULT_NODES = "127.0.0.1:2181";
    private static final int DEFAULT_SESSION_TIMEOUT = 5000;
    private static final int DEFAULT_SLEEP_TIME_SECONDS = 1;
    private static final int DEFAULT_MAX_RETRIES = 10;
    private static final boolean DEFAULT_ENABLE = true;
    //变量
    private boolean enbale = DEFAULT_ENABLE;
    private String nodes = DEFAULT_NODES;
    private Integer sessionTimeout = DEFAULT_SESSION_TIMEOUT;
    private Integer sleepTimeSeconds = DEFAULT_SLEEP_TIME_SECONDS;
    private Integer maxRetries = DEFAULT_MAX_RETRIES;

    public boolean isEnbale() {
        return enbale;
    }

    public void setEnbale(boolean enbale) {
        this.enbale = enbale;
    }

    public String getNodes() {
        return nodes;
    }

    public void setNodes(String nodes) {
        this.nodes = nodes;
    }

    public Integer getSessionTimeout() {
        return sessionTimeout;
    }

    public void setSessionTimeout(Integer sessionTimeout) {
        this.sessionTimeout = sessionTimeout;
    }

    public Integer getSleepTimeSeconds() {
        return sleepTimeSeconds;
    }

    public void setSleepTimeSeconds(Integer sleepTimeSeconds) {
        this.sleepTimeSeconds = sleepTimeSeconds;
    }

    public Integer getMaxRetries() {
        return maxRetries;
    }

    public void setMaxRetries(Integer maxRetries) {
        this.maxRetries = maxRetries;
    }
}
